package com.yuexun.dhdoctor.module.Contract.model.impl;


import com.yuexun.dhdoctor.base.BaseEntity;
import com.yuexun.dhdoctor.module.Contract.api.GroupApi;
import com.yuexun.dhdoctor.module.Contract.bean.GroupGroupData;
import com.yuexun.dhdoctor.module.Contract.model.IGroupModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/7/20.
 */
public class GroupModel implements IGroupModel {
    private GroupApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public GroupApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(GroupApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<GroupGroupData>> getGroupDatas(Map<String, String> praise) {
        api = ApiInstance();
        return api.getGroupDatas(praise);
    }
}
